package com.molin.conllectionTest;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Demo3 {
    public static void main(String[] args) {
        Collection collection=new ArrayList<String>();
        collection.add("ab");
        collection.add("cd");
        collection.add("ef");
        collection.add("gr");
        collection.add("hg");

        Iterator<String> iterator=collection.iterator();
        while (iterator.hasNext()){
            String s=iterator.next();

            System.out.println(s);
        }
    }
}
